package cn.zy.shardbatisdemo.controller;

import cn.zy.shardbatisdemo.service.ShardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhagnying
 * @description
 * @date 2019/9/10
 */
@Controller
@RequestMapping(value = "/Shardbatis")
public class ShardbatisController {

    @Autowired
    private ShardService shardService;

    @ResponseBody
    @GetMapping(value = "/startShard")
    public String test(@RequestParam(value = "id") String id){
        return shardService.getName(id);
    }

}
